package com.controller;

import com.Service.ListingService;
import com.model.pojo.Buildcard;
import com.model.pojo.Listing;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;
import javax.servlet.http.HttpSession;
import java.util.List;

@Controller
@RequestMapping("Listing")
public class ListingController {
    @Resource
    public ListingService listingService;
    @Resource
    public Buildcard buildcard;


    @RequestMapping("Listing")
    public  String listMessage(HttpSession session){

       List<Listing> list= listingService.listMessage();
        System.out.println("1");
       if(list!=null){
            session.setAttribute("list",list);
           return "Listting";
       }else {//需改
           return "Listting";
       }
    }

    @RequestMapping("listOfPayCost")
    public String listOfPayCost(HttpSession session){

        List<Listing> list= listingService.listOf();
        System.out.println(list);
        if(list!=null){
            session.setAttribute("list",list);
            return "listtingList";
        }else {//需改
            return "listtingList";
        }
    }
}
